import React, {Component} from 'react';
import {Route,Switch, Redirect} from 'react-router-dom';
import TouchHeader from '@/components/Home/TouchHeader';
import SearchHeader from '@/components/Home/SearchHeader';
import HomeNavbar from '@/components/Home/HomeNavbar';
import MuYing from './MuYing';
import MingPin from './MingPin';
import QingShe from './QingShe';
import HomeHome from '@/views/index/home/shouye/HomeHome';
import JiSu from '@/views/index/home/jisu/JiSu';
// import HomeHome from '@/views/index/home/shouye/HomeHome';
import './home.scss';
export default class Home extends Component{
  render () {
    var reg = new RegExp('^/home/home');
    return (
        <div className="home">
          {
            reg.test(this.props.location.pathname) ? '' : <TouchHeader></TouchHeader>
          }
          <SearchHeader></SearchHeader>
          <HomeNavbar></HomeNavbar>
          <Switch>
            <Route path="/home/home" component={HomeHome}></Route>
            <Route path="/home/jisu" component={JiSu}></Route>
            <Route path="/home/muying" component={MuYing}></Route>
            <Route path="/home/mingpin" component={MingPin}></Route>
            <Route path="/home/qingshe" component={QingShe}></Route>
            <Redirect to="/home/home"></Redirect>
          </Switch>
        </div>
    )
  }
}
